﻿// ----------------------------------------------------------------------------------
// Microsoft Developer & Platform Evangelism
// 
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
// ----------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
// ----------------------------------------------------------------------------------

namespace umbraco.ACSExtensions
{
    using System;

    public class WSFederationElement
    {
        private string authenticationType;
        private int? freshness;
        private string homeRealm;
        private string issuer;
        private bool passiveRedirectEnabled;
        private string policy;
        private string realm;
        private string reply;
        private string request;
        private string requestPtr;
        private bool requireHttps;
        private string resource;
        private string signInMode;
        private string signInQueryString;

        public WSFederationElement(string issuer, string realm)
            : this(issuer, realm, true)
        {
        }

        public WSFederationElement(string issuer, string realm, bool passiveRedirectEnabled)
        {
            this.requireHttps = true;
            if (string.IsNullOrEmpty(issuer))
            {
                throw new ArgumentNullException("issuer");
            }

            if (string.IsNullOrEmpty(realm))
            {
                throw new ArgumentNullException("realm");
            }

            this.issuer = issuer;
            this.realm = realm;
            this.passiveRedirectEnabled = passiveRedirectEnabled;
        }

        public string AuthenticationType
        {
            get
            {
                return this.authenticationType;
            }
            set
            {
                this.authenticationType = value;
            }
        }

        public int? Freshness
        {
            get
            {
                return this.freshness;
            }
            set
            {
                this.freshness = value;
            }
        }

        public string HomeRealm
        {
            get
            {
                return this.homeRealm;
            }
            set
            {
                this.homeRealm = value;
            }
        }

        public string Issuer
        {
            get
            {
                return this.issuer;
            }
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentNullException("issuer");
                }

                this.issuer = value;
            }
        }

        public bool PassiveRedirectEnabled
        {
            get
            {
                return this.passiveRedirectEnabled;
            }
            set
            {
                this.passiveRedirectEnabled = value;
            }
        }

        public string Policy
        {
            get
            {
                return this.policy;
            }
            set
            {
                this.policy = value;
            }
        }

        public string Realm
        {
            get
            {
                return this.realm;
            }
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentNullException("realm");
                }

                this.realm = value;
            }
        }

        public string Reply
        {
            get
            {
                return this.reply;
            }
            set
            {
                this.reply = value;
            }
        }

        public string Request
        {
            get
            {
                return this.request;
            }
            set
            {
                this.request = value;
            }
        }

        public string RequestPtr
        {
            get
            {
                return this.requestPtr;
            }
            set
            {
                this.requestPtr = value;
            }
        }

        public bool RequireHttps
        {
            get
            {
                return this.requireHttps;
            }
            set
            {
                this.requireHttps = value;
            }
        }

        public string Resource
        {
            get
            {
                return this.resource;
            }
            set
            {
                this.resource = value;
            }
        }

        public string SignInMode
        {
            get
            {
                return this.signInMode;
            }
            set
            {
                this.signInMode = value;
            }
        }

        public string SignInQueryString
        {
            get
            {
                return this.signInQueryString;
            }
            set
            {
                this.signInQueryString = value;
            }
        }
    }
}